#ifndef USER_HPP_
#define USER_HPP_

#include <string>
#include <set>
#include <memory>
#include <vector>
#include "system/socket/Connection.hpp"

namespace KitUser
{
	/**
	 * This class represent connected user and keeps information about
	 * its followers and connection, that might be used to send events
	 * coming to the proper user.
	 */
	class User
	{
	public:
		/**
		 * Create user object and pass the connection on which we will be
		 * sending events.
		 *
		 * \param iConnection user connection to send event.
		 */
		User(SystemSocket::Connection * iConnection);
		/**
		 * Just destructor. Nothing special.
		 */
		~User();
		/**
		 * This method is used to inform the user that there is another user
		 * that follows him.
		 *
		 * \param iFollowerId ID of follower that should be add
		 */
		void addFollower(std::string iFollowerId);
		/**
		 * This method is used to remove followers of the user.
		 *
		 * \param iFollowerId ID of follower that should be removed
		 */
		void removeFollower(std::string iFollowerId);

		/**
		 * \return Returns a vector of all followers.
		 */
		const std::vector<std::string>  getFollowers() const;

		/**
		 * \return Returns user connection.
		 */
		SystemSocket::Connection * getConnection() {return _connection;}

	private:
		// keeps the ids of user followers
		std::set <std::string> _followers;
		// keeps user connection
		SystemSocket::Connection * _connection;
	};
}


#endif /* USER_HPP_ */
